<div id="uploadDiv" class="dropper"></div>
<table width="100%" style="margin-top:12px">
    <tr>
        <td>
            <h5>注意事项</h5>
        </td>
    </tr>
    <tr>
        <td>
            <div style="font-size:13px;line-height:25px">
                <b>1.</b>&nbsp;仅支持上传ZIP格式的压缩包，请不要压缩成RAR格式后再直接将后缀修改为ZIP；
                <br>
                <b>2.</b>&nbsp;上传压缩包后，请注意检查里面的文件（<span style="color:red">红色字体</span>表示上传文件有问题；<span style="color:blue">蓝色字体</span>表示上传的文件不在项目根路径下）
            </div>
        </td>
    </tr>
</table>
<link href="/public/js/dropper/jquery.fs.dropper.css" rel="stylesheet" type="text/css" media="all">
<link rel="stylesheet" href="/public/js/zeroModal/zeroModal.css" />
<script src="/public/amazeUI/js/jquery.min.js"></script>
<script src="/public/js/dropper/jquery.fs.dropper.js"></script>
<script src="/public/js/zeroModal/zeroModal.min.js"></script>
<script type="text/javascript">
$(function() {
    $("#uploadDiv").dropper({
        action: "/upgradePackage/doUpload",
        label: "拖放或单击选中ZIP格式的文件",
        check: function(files) {
            for (var i = 0; i < files.length; i++) {
                var suffix = files[i].name.substr(files[i].name.length - 3, files[i].name.length);
                if (suffix != "zip") {
                    zeroModal.error({
                        content: '文件格式有误！',
                        contentDetail: '只能是后缀为zip的文件'
                    });
                    return false;
                }
            }
            return true;
        },
        postKey: "file1",
        maxQueue: 1
    }).on("start.dropper", function(e, files) {

    }).on("complete.dropper", function() {
        parent.$.toast({ text: '上传成功！', showHideTransition: 'slide', icon: 'success', position: 'top-center' });
        parent.zeroModal.closeAll();
    });
});
</script>